package com.my.commonlib.util;

import android.os.Build;

public class SDKUtil {
	/** Android 2.2 SDK API 8 */
	public static boolean hasFroyo() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO;
    }
	
	/** Android 2.3.1 API 9 */
    public static boolean hasGingerbread() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD;
    }

    /** Android 3.0 API 11 */
    public static boolean hasHoneycomb() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB;
    }

    /** Android 3.1 API 12 */
    public static boolean hasHoneycombMR1() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1;
    }

    /** Anroid 4.1 API 16 */
    public static boolean hasJellyBean() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;
    }
    
    /** Anroid 4.2 API 17 */
    public static boolean hasJellyBeanMR1() {
        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1;
    }
    
    /** Anroid 4.3 API 18 */
    public static boolean hasJellyBeanMR2(){
    	return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2;
    }
    
    /** Android 4.4 API 19*/
    public static boolean hasKitKat(){
    	return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
    }
    
    /** Android 4.4 API 21*/
    public static boolean hasLollipop(){
    	return Build.VERSION.SDK_INT >= 21;
    }

    /**
     * Android M  API 23
     * @return
     */
    public static boolean hasMashroom(){
        return Build.VERSION.SDK_INT >=  Build.VERSION_CODES.M;
    }
}
